﻿@model KL.Store.Web.Models.ProductModel
@using KL.Store.Core
@using KL.Store.Data
@using KL.Store.Core.Domain;
@{
    Layout = null;
    /*if (!string.IsNullOrEmpty(Model.UstLinkUrl))
    {
        Response.Redirect(Model.UstLinkUrl);
    }*/
    var productDetailsFullClass = "col-xs-12 col-sm-12 col-md-12 col-lg-9 first last product-review product-review-main";
    var productImageClass = "col-xs-12 col-sm-12 col-md-6 col-lg-6 first last product-images";
    var productDetailsClass = "col-xs-12 col-sm-12 col-md-6 col-lg-6 product-prices first";
    var productRelatedsPosition = "right"; //bottom or right
    var installmentTableWidth = "col-xs-12 col-sm-6 col-md-4 col-lg-3";
    var categoriesClass = "";
    var productTabClass = "product-tabs";
    var infoBlockClass = "product-info-block";
    var zoomContainerWidth = "400";
    var zoomContainerHeight = "400";
    var showCategoriesOnLeft = false;
    var sliderThumbs = true;

    var priceFilterStr = "###,###,##0.00";
    if (Parameters.HideOddFromPrice)
    {
        priceFilterStr = "###,###,##0";
    }

    var linkedImageType = "_s";
    if (Parameters.Theme == "HA")
    {
        productDetailsFullClass = "col-xs-12 col-sm-12 col-md-12 col-lg-12 first last product-review product-review-main";
        productImageClass = "col-xs-12 col-sm-12 col-md-7 col-lg-7 first last product-images";
        productDetailsClass = "col-xs-12 col-sm-12 col-md-5 col-lg-5 product-prices last";
        productRelatedsPosition = "bottom";
        installmentTableWidth = "col-xs-12 col-sm-6 col-md-4 col-lg-3";
        zoomContainerWidth = "400";
        zoomContainerHeight = "400";
        linkedImageType = "_w";
    }
    else if (Parameters.Theme == "WU")
    {
        productDetailsFullClass = "col-xs-12 col-sm-12 col-md-8 col-lg-9 first product-review product-review-main";
        categoriesClass = "hidden-xs hidden-sm col-md-4 col-lg-3 left";
        showCategoriesOnLeft = true;
        productImageClass = "col-xs-12 col-sm-12 col-md-6 col-lg-6 first product-images";
        productDetailsClass = "col-xs-12 col-sm-12 col-md-6 col-lg-6 product-prices first";
        installmentTableWidth = "col-xs-12 col-sm-12 col-md-6 col-lg-6";

        productRelatedsPosition = "left";
        zoomContainerWidth = "400";
        zoomContainerHeight = "400";
        productTabClass = "product-tabs col-xs-12 col-sm-12 col-md-8 col-lg-9 first right";
    }
    else if (Parameters.Theme == "JB")
    {
        productImageClass = "col-xs-12 col-sm-12 col-md-6 col-lg-6 first last product-images";
        productDetailsClass = "col-xs-12 col-sm-12 col-md-6 col-lg-6 product-prices first";
        installmentTableWidth = "col-xs-12 col-sm-12 col-md-4 col-lg-3";
        productRelatedsPosition = "bottomright";
        zoomContainerWidth = "333";
        zoomContainerHeight = "400";
        productTabClass = "product-tabs col-xs-12 col-sm-12 col-md-5 col-lg-5 first";
        sliderThumbs = false;
    }
    else if (Parameters.Theme == "DK")
    {
        productDetailsFullClass = "col-xs-12 col-sm-12 col-md-8 col-lg-9 first last product-review product-review-main";
        categoriesClass = "hidden-xs hidden-sm col-md-4 col-lg-3 first left";
        showCategoriesOnLeft = true;
        productImageClass = "col-xs-12 col-sm-12 col-md-5 col-lg-5 first product-images";
        productDetailsClass = "col-xs-12 col-sm-12 col-md-7 col-lg-7 product-prices first";
        installmentTableWidth = "col-xs-12 col-sm-12 col-md-6 col-lg-6";

        productRelatedsPosition = "bottom";
        zoomContainerWidth = "286";
        zoomContainerHeight = "277";
        productTabClass = "product-tabs col-xs-12 col-sm-12 col-md-8 col-lg-9 first last right";
    }
    else if (Parameters.Theme == "EO")
    {
        productDetailsFullClass = "col-xs-12 col-sm-12 col-md-8 col-lg-9 first last product-review product-review-main";
        categoriesClass = "hidden-xs hidden-sm col-md-4 col-lg-3 first left";
        showCategoriesOnLeft = true;
        productImageClass = "col-xs-12 col-sm-12 col-md-5 col-lg-5 first product-images";
        productDetailsClass = "col-xs-12 col-sm-12 col-md-7 col-lg-7 product-prices first";
        installmentTableWidth = "col-xs-12 col-sm-12 col-md-6 col-lg-6";

        productRelatedsPosition = "left";
        zoomContainerWidth = "286";
        zoomContainerHeight = "277";
        productTabClass = "product-tabs col-xs-12 col-sm-12 col-md-8 col-lg-9 first last right";
    }

    var productImageGoogleOk = false;
    var productIdForDetails = (Model.variantPropertiesList != null && Model.variantPropertiesList.Count() > 0 && !Model.variantPropertiesList.Select(o => o.productId).Contains(Model.ProductId)) ? Model.variantPropertiesList.FirstOrDefault().productId : Model.ProductId;
    var firstVariantId = Model.variantPropertiesList != null && Model.variantPropertiesList.Count() > 0 ? (Model.variantPropertiesList.Where(o => o.productId == productIdForDetails).FirstOrDefault() != null ? Model.variantPropertiesList.Where(o => o.productId == productIdForDetails).FirstOrDefault().id : Model.variantPropertiesList.FirstOrDefault().id) : 0;
    var productName = Model.ProductId != productIdForDetails && Model.variantPropertiesList != null && Model.variantPropertiesList.Where(o => o.productId == productIdForDetails).Count() > 0 ? (!string.IsNullOrEmpty(Model.variantPropertiesList.Where(o => o.productId == productIdForDetails).FirstOrDefault().ProductName) ? Model.variantPropertiesList.Where(o => o.productId == productIdForDetails).FirstOrDefault().ProductName : Model.ProductName) : Model.ProductName;
}
@if (Model.BreadCrumb != "" && Model.Group.CategoryType != "S" && Model.Group.CategoryType != "M")
{
    <div class="breadcrumb col-xs-12 col-sm-12 col-md-12 col-lg-12">
        <div class="bcBorder"></div>
        <div class="bcLinks">
            @Html.Raw(Model.BreadCrumb)
        </div>
        <div class="bcBorder"></div>
    </div>
}
@if (Model.IsManager || Model.IsSeoManager)
{
    <div class="edit-genel">
        <a href="/ProductManage/Edit/@(Model.ProductId)" class="urunDuzenle fancybox.iframe">
            <i class="fa fa-edit fa-2x"></i>
        </a>
    </div>
}
<meta itemprop="url" content="@(Parameters.WebSiteUrl)/urun@(Model.LinkUrl)" />
<div itemprop="brand" itemscope itemtype="http://schema.org/Brand">
    <meta  itemprop="name" content="@(Model.Brand)" />
</div>
@if (showCategoriesOnLeft)
{
    <div class="@categoriesClass">
        @{Html.RenderAction("Categories", "Partials");}
        @if (productRelatedsPosition == "left")
        {
            Html.RenderAction("RelatedProductsInCategory", "Partials", new { CategoryId = Model.CategoryId, CategoryName = Model.Category, ItemId = Model.ProductId, ItemCount = Parameters.MaxProductCountForRelatedProducts, Position = "left", Title = "Benzer Ürünler", randomOrder = true });
        }
    </div>
}
<div class="@productDetailsFullClass">
    <div class="@productImageClass">
        @if (Parameters.ProductViewSliderType == 1)
        {
            <div class="product-slider">
                <div>
                    <ul id="product-slider">

                        @{ bool thumbnailFounded = false; }
                        @if (Parameters.ProductDetailShowSingleImage || (Model.ProductImages != null && Model.ProductImages.Count >= 1))
                        {
                            thumbnailFounded = true;
                            foreach (var productImage in Model.ProductImages)
                            {
                            <li class="productImage@(productImage.ProductId)">
                                <a href="@(Parameters.WebSiteImageUrl)/product-big/@(productImage.ProductId)_@(productImage.ImageId).jpg" rel="lightbox">
                                    <img src="@(Parameters.WebSiteImageUrl)/product-large/@(productImage.ProductId)_@(productImage.ImageId).jpg" data-zoom-image="@(Parameters.WebSiteImageUrl)/product-big/@(productImage.ProductId)_@(productImage.ImageId).jpg" @{if (productImage.ImageId == 1 && !productImageGoogleOk)
                                                                                                                                                                                                                                                                     {
                                                                                                                                                                                                                                                                         productImageGoogleOk = true;
                                                                                                                                                                                                                                                                         <text> itemprop="image" alt="</text>@Model.ProductName<text>"</text> }} />
                                </a>
                            </li>
                            }
                        }
                        else
                        {
                            <li>
                                <img src="/Images/@Parameters.Theme/product-image-not-found-400x.jpg" />
                            </li>
                        }
                    </ul>
                    @if (thumbnailFounded && sliderThumbs)
                    {
                        <div class="product-thumb-box">
                            <ul class="product-thumbs">
                                @{int thumbCounter = 0;
                                  foreach (var productThumb in Model.ProductImages)
                                  {
                                    <li id="slide@(thumbCounter + 1)" class="productImage@(productThumb.ProductId)"><a href="#@(thumbCounter + 1)" data-slide="@(thumbCounter + 1)">
                                        <img src="@(Parameters.WebSiteImageUrl)/product-small/@(productThumb.ProductId)_@(productThumb.ImageId).jpg" /></a></li>
                                      thumbCounter++;
                                  }
                                }
                            </ul>
                        </div>
                    }
                </div>
                <script>
                    $(function ()
                    {
                        var v3slider = $('#product-slider').slippry({
                            // general elements & wrapper
                            slippryWrapper: '<div class="slippry_box thumbnails" />',
                            // options
                            transition: 'horizontal',
                            pager: false,
                            auto: true,
                            pause: 4500,
                            onSlideBefore: function (el, index_old, index_new)
                            {
                                $('.product-thumbs a img').removeClass('active').parent().css({ "background": "none" });
                                $('img', $('.product-thumb-box .product-thumbs li a')[index_new]).addClass('active');
                            @if (Parameters.Theme == "HA")
                            {
                                @Html.Raw("$('img', $('.product-thumb-box .product-thumbs li a')[index_new]).parent().css({ \"background\": \"url('/Images/HA/slider-thumbnail-top-background.jpg') repeat-x\" });");
                            }
                                $('body').removeClass('loading');
                                $.removeData(".product-slider #product-slider li a", 'elevateZoom');
                                $('.zoomContainer').remove();
                                $('.product-slider #product-slider li a').elevateZoom({
                                    loadingIcon: false,
                                    responsive: true,
                                    cursor: "zoom-in",
                                    zoomType: "inner",
                                    scrollZoom: true,
                                    zoomWindowWidth: '@zoomContainerWidth',
                                    zoomWindowHeight: '@zoomContainerHeight'
                                });
                            }
                        });

                        $('.product-thumb-box .product-thumbs li a').click(function ()
                        {
                            v3slider.goToSlide($(this).data('slide'));
                            return false;
                        });
                        $('.product-slider #product-slider a[rel=lightbox]').lightBox({
                            imageLoading: '/Images/@Parameters.Theme/lb05/lightbox-ico-loading.gif',
                            imageBtnClose: '/Images/@Parameters.Theme/lb05/lightbox-btn-close.png',
                            imageBtnPrev: '/Images/@Parameters.Theme/lb05/lightbox-btn-prev.png',
                            imageBtnNext: '/Images/@Parameters.Theme/lb05/lightbox-btn-next.png',
                            txtImage: 'Resim',
                            txtOf: '/',
                            keyToClose: 'k',
                            keyToPrev: 'n',
                            keyToNext: 'm'
                        });
                    });
                </script>
            </div>
        }
        else
        {
            <div class="product-flexslider">
                <div class="discountOuter">
                    @if (Model.DiscountPercent > 0 || Model.DiscountTotal > 0 || Model.DiscountDisplayTotal > 0)
                    {
                        if (Model.DiscountPercent > 0)
                        {
                        <div class="discountView discountView2">%@Model.DiscountPercent.ToString("###,###,##0")<span class="dsccls">İNDİRİM</span></div>
                        }
                        else if (Model.DiscountTotal > 0)
                        {
                        <div class="discountView discountView2">@(Model.DiscountTotal.ToString("###,###,##0"))@Html.Raw(Model.Currency == "TL" ? "<i class=\"fa fa-try\"></i>" : " " + Model.Currency)<span class="dsccls">İNDİRİM</span></div>
                        }
                        else if (Model.DiscountDisplayTotal > 0)
                        {
                        <div class="discountView discountView2">%@Model.DiscountDisplayTotal.ToString("###,###,##0")<span class="dsccls">İNDİRİM</span></div>
                        }
                    }
                </div>
                <div id="slider" class="flexslider">
                    <ul class="slides">
                        @if (Parameters.ProductDetailShowSingleImage || (Model.ProductImages != null && Model.ProductImages.Count >= 1))
                        {
                            foreach (var productImage in Model.ProductImages)
                            { 
                            <li class="not-clone productImage@(productImage.ProductId)">
                                <a href="@(Parameters.WebSiteImageUrl)/product-big/@(productImage.ProductId)_@(productImage.ImageId).jpg" data-zoom-image="@(Parameters.WebSiteImageUrl)/product-big/@(productImage.ProductId)_@(productImage.ImageId).jpg" rel="lightbox">
                                    @if (Parameters.Theme == "HwWSSA")
                                    {
    
                                        <img src="@(Parameters.WebSiteImageUrl)/product-large/@(productImage.ProductId)_@(productImage.ImageId)_w.jpg" data-zoom-image="@(Parameters.WebSiteImageUrl)/product-big/@(productImage.ProductId)_@(productImage.ImageId).jpg" @{if (productImage.ImageId == 1 && !productImageGoogleOk)
                                                                                                                                                                                                                                                                           {
                                                                                                                                                                                                                                                                               productImageGoogleOk = true;
                                                                                                                                                                                                                                                                          <text>itemprop="image" alt="</text>@Model.ProductName<text>"</text> }} />
                                    }
                                    else
                                    {
                                        <img src="@(Parameters.WebSiteImageUrl)/product-large/@(productImage.ProductId)_@(productImage.ImageId).jpg" data-zoom-image="@(Parameters.WebSiteImageUrl)/product-big/@(productImage.ProductId)_@(productImage.ImageId).jpg" @{if (productImage.ImageId == 1 && !productImageGoogleOk)
                                                                                                                                                                                                                                                                         {
                                                                                                                                                                                                                                                                             productImageGoogleOk = true;
                                                                                                                                                                                                                                                                         <text>itemprop="image" alt="</text>@Model.ProductName<text>"</text> }} />
   
                                    }
                                </a>
                            </li>
                            }
                        }
                        else
                        {
                            <li>
                                <img src="/Images/@Parameters.Theme/product-image-not-found-400x.jpg" />
                            </li>   
                        }
                    </ul>
                </div>
                @{ bool thumbnailFounded = false; }
                @if (Parameters.ProductDetailShowSingleImage || (Model.ProductImages != null && Model.ProductImages.Count > 1))
                {
                    thumbnailFounded = true;
                    <div id="carousel" class="flexslider">
                        <ul class="slides">
                            @foreach (var productImage in Model.ProductImages)
                            { 
                                <li class="productImage@(productImage.ProductId)">
                                    <img src="@(Parameters.WebSiteImageUrl)/product-small/@(productImage.ProductId)_@(productImage.ImageId)_w.jpg" />
                                </li>
                            }
                        </ul>
                    </div>
                }
            </div>
                if (!thumbnailFounded && sliderThumbs)
                {
@*<div style="height: 70px;"></div>*@
                }                              
            <script type="text/javascript">
                $(window).load(function ()
                {
                    $('#carousel').flexslider({
                        animation: "slide",
                        controlNav: false,
                        animationLoop: false,
                        slideshow: false,
                        itemWidth: 94,
                        itemMargin: 5,
                        asNavFor: '#slider'
                    });

                    $('#slider').flexslider({
                        animation: "slide",
                        controlNav: false,
                        animationLoop: true,
                        slideshow: false,
                        sync: "#carousel",
                        start: function (slider)
                        {
                            if ($(document).width() > 999)
                            {
                                $('body').removeClass('loading');
                                $.removeData(".slides li", 'elevateZoom');
                                $('.zoomContainer').remove();
                                $('.slides li.flex-active-slide a').elevateZoom({
                                    loadingIcon: false,
                                    responsive: true,
                                    cursor: "zoom-in",
                                    zoomType: "inner"
                                });
                            }
                        },
                        before: function (slider)
                        {
                            if ($(document).width() > 999)
                            {
                                $('body').removeClass('loading');
                                $.removeData(".slides li", 'elevateZoom');
                                $('.zoomContainer').remove();
                            }
                        },
                        after: function ()
                        {
                            if ($(document).width() > 999)
                            {
                                var active_rel = $(this).find('.flex-active-slide').attr('rel');
                                $.removeData(".slides li a", 'elevateZoom');
                                $('.zoomContainer').remove();
                                $('.slides li.flex-active-slide a').elevateZoom({
                                    loadingIcon: false,
                                    responsive: true,
                                    cursor: "zoom-in",
                                    zoomType: "inner"
                                });
                            }
                        }
                    });
                    if ($(document).width() > 999)
                    {
                        $('.product-flexslider #slider .slides .clone a').removeAttr("rel");
                        $('.product-flexslider #slider .slides .not-clone a[rel=lightbox]').lightBox({
                            imageLoading: '/Images/@Parameters.Theme/lb05/lightbox-ico-loading.gif',
                            imageBtnClose: '/Images/@Parameters.Theme/lb05/lightbox-btn-close.png',
                            imageBtnPrev: '/Images/@Parameters.Theme/lb05/lightbox-btn-prev.png',
                            imageBtnNext: '/Images/@Parameters.Theme/lb05/lightbox-btn-next.png',
                            txtImage: 'Resim',
                            txtOf: '/',
                            keyToClose: 'k',
                            keyToPrev: 'n',
                            keyToNext: 'm'
                        });
                    }
                    var thumbsWidth = 0;
                    var slideImgCount = $('.product-flexslider #carousel .slides li').size();
                    if (slideImgCount > 0)
                    {
                        var slideBigAreaWidth = $('.product-flexslider').width();
                        var slideThumbMargin = $('.product-flexslider #carousel .slides li').not(':first-child').css('margin-left');
                        slideThumbMargin = parseInt(slideThumbMargin.replace('px', ''));


                        $('.product-flexslider #carousel .slides li').each(function ()
                        {
                            thumbsWidth += $(this).width();
                        });
                        thumbsWidth += ((slideImgCount - 1) * slideThumbMargin) + (slideImgCount * 2);

                        if (thumbsWidth <= slideBigAreaWidth)
                        {
                            $('.flex-direction-nav').remove();
                            $('.product-flexslider #carousel .flex-viewport').css('padding', '0');
                        }
                    }
                });
            </script>
        }
        <div class="clearfix"></div>
    </div>
    <div class="@productDetailsClass">
        <div class="product-titles">
            <h1 itemprop="name">@productName@(Model.ShowModelOnProductDetails && !string.IsNullOrEmpty(Model.Model) ? " - " + Model.Model : "")</h1>
            @if (Parameters.Theme != "HA")
            {
                <div class="product-code">Ürün Kodu : @Model.ProductCode</div>
            }
            @if (Parameters.Theme != "HA")
            {
                <div class="extra-buttons">
                    <a href="#urunSoruSor" class="bolder urunSoruSorLink">@(!string.IsNullOrEmpty(Model.QuestionText) ? Model.QuestionText : Parameters.ProductDefaultQuestionText)</a><br />
                    <div class="clearfix"></div>
                </div>
            }
        </div>
        <div class="product-center">

            <div id="product-view-prices-div">
                @{Html.RenderAction("ProductPrices", "Product", new { id = productIdForDetails, pRelPos = productRelatedsPosition });}
            </div>
            @if (Parameters.Theme == "HA" || Parameters.Theme == "WU")
            {
                <div class="productAddToCart">
                    @if (Model.IsActive)
                    {
                        Html.RenderAction("ProductAddToCart", "Product", new { id = productIdForDetails, pRelPos = productRelatedsPosition, selectedVariant = firstVariantId });
                    }
                    else
                    {
                        <div class="bg-info bs-bgb" style="margin: 15px 0;">
                            <p><span class="glyphicon glyphicon-info-sign"></span>&nbsp;Bu ürün geçici olarak temin edilememektedir. Anlayışınız için teşekkür ederiz.</p>
                        </div>
                    }
                </div>
                <div class="clearfix"></div>
                <div class="product-addthis">
                    <div class="left">
                        @Html.Raw(Parameters.AddThisShareButtonsProductPageScript)
                        <a class="product-addthis-print-icon" target="_blank" rel="nofollow" href="/Product/Print/@(Model.ProductId.ToString())" style="padding:0 2px;">
                            <img src="/Images/@(Parameters.Theme)/product-print.jpg" alt="Sayfayı Yazdır" title="Sayfayı Yazdır" /></a>
                    </div>
                    @if (Parameters.Theme == "WU" || Parameters.Theme == "HA")
                    {
                        <div class="left" style="margin-left: 3px;">
                            <img src="/Images/@Parameters.Theme/paylasmak-guzeldir.jpg" width="171" height="31" />
                        </div>
                    }
                </div>
            }
            else
            {
                if (Model.variantPropertiesList.Count() >= 1)
                {
                <div class="variantList">
                    <label for="variantProduct">Ürün Özelliği Seçiniz: </label>
                    <select name="variantProduct" id="variantProduct">
                        @foreach (var variant in Model.variantPropertiesList)
                        {
                            <option value="@variant.productId" @{if (ViewBag.SelectedProductId == variant.productId)
                                                                 {<text>selected="selected"</text>}}>@variant.value</option>
                        }
                    </select>
                </div>                    
                }
                <div class="clearfix"></div>
                <div class="productAddToCart">

                    @if (Model.IsActive)
                    {
                        Html.RenderAction("ProductAddToCart", "Product", new { id = productIdForDetails });
                    }
                    else
                    {
                        <div class="bg-info bs-bgb" style="margin: 15px 0;">
                            <p><span class="glyphicon glyphicon-info-sign"></span>&nbsp;Bu ürün geçici olarak temin edilememektedir. Anlayışınız için teşekkür ederiz.</p>
                        </div>
                    }
                </div>
                    if (Parameters.Theme == "JB")
                    {
                <div class="category-banner">
                    @Html.Raw(Parameters.ProductPageDescriptionWide)
                </div>            
                    }
                <div class="product-addthis">
                    <div class="left">
                        <div class="left">
                            @Html.Raw(Parameters.AddThisShareButtonsProductPageScript)
                        </div>
                        <div class="left">
                            <a target="_blank" rel="nofollow" href="/Product/Print/@(Model.ProductId.ToString())" style="padding:0 2px;">
                                <img src="/Images/@(Parameters.Theme)/product-print.jpg" alt="Sayfayı Yazdır" title="Sayfayı Yazdır" /></a>
                        </div>
                        <div class="left" style="margin-left: 3px;">
                            <img src="/Images/@Parameters.Theme/paylasmak-guzeldir.jpg" width="171" height="31" />
                        </div>
                    </div>
                    <div class="clearfix"></div>
                </div>
                    if (Parameters.Theme == "JB" && productRelatedsPosition != "bottomright")
                    {
                <div class="product-contact">
                    <hr />
                    <div class="col-xs-6 first">
                        <h5>Telefon Destek Hattı</h5>
                        @Parameters.PrimaryPhoneNumber<br />
                        (09:00 - 18:30 Pazar Günü Hariç)
                    </div>
                    <div class="col-xs-6 last">
                        <h5>Müşteri Destek Hattı</h5>
                        <a href="#urunSoruSor" class="bolder urunSoruSorLink">Müşteri temsilcimizden<br />
                            Destek almak için tıklayınız</a>
                    </div>
                </div>
                    }
            }
        </div>
        <div class="clearfix"></div>
    </div>
    <div class="clearfix"></div>
    @if (Parameters.Theme != "JB" && Parameters.Theme != "HA")
    {
        <div class="col-xs-12 col-sm-12 col-md-8 col-lg-8 first last prod-warranty">
            @if (Model.BrandBannerActive)
            {
                <div class="category-banner">
                    <img src="@(Parameters.WebSiteImageUrl)/category-banner/@(Model.BrandId).jpg" alt="@Model.Brand" />
                </div>
            }
            else if (Model.CategoryBannerActive)
            {
                <div class="category-banner">
                    <img src="@(Parameters.WebSiteImageUrl)/category-banner/@(Model.CategoryId).jpg" alt="@Model.Category" />
                </div>
            }
            else if (Model.ParentCategoryBannerActive)
            {
                <div class="category-banner">
                    <img src="@(Parameters.WebSiteImageUrl)/category-banner/@(Model.ParentCategoryId).jpg" alt="@Model.ParentCategoryId" />
                </div>
            }
            else if (Parameters.Theme != "JB")
            {
                <div class="category-banner">
                    @Html.Raw(Parameters.ProductPageDescriptionWide)
                </div>            
            }
            <div class="clearfix"></div>
        </div>
    }
    @if (!string.IsNullOrEmpty(Parameters.ProductPageDescriptionSmall) && Parameters.Theme != "JB")
    {
        <div class="col-xs-12 col-sm-12 col-md-4 col-lg-4 product-installment">
            @Html.Raw(Parameters.ProductPageDescriptionSmall)
            <div class="clearfix"></div>
        </div>
    }
</div>
@if (productRelatedsPosition == "right")
{
    <div class="hidden-xs hidden-sm col-md-12 col-lg-3 first last">
        <!--Benzer Ürünler-->
        @{Html.RenderAction("RelatedProductsInCategory", "Partials", new { CategoryId = Model.CategoryId, CategoryName = Model.Category, ItemId = Model.ProductId, ItemCount = Parameters.MaxProductCountForRelatedProducts, Position = "right", Title = "Benzer Ürünler", randomOrder = true });}
        <!--Benzer Ürünler-->
    </div>
}
else if (Parameters.Theme == "JB")
{
    <div class="hidden-xs hidden-sm hidden-md col-lg-3 first last productRightBannerSection">

        @if (!string.IsNullOrEmpty(Parameters.ProductPageDescriptionSmall))
        {
            <div class="category-banner">
                @Html.Raw(Parameters.ProductPageDescriptionSmall)
                <div class="clearfix"></div>
            </div>
            Html.RenderAction("ManageContentLink", "Partials", new { id = 350 });
        }
        @if (Model.BrandBannerActive)
        {
            <div class="category-banner">
                <img src="@(Parameters.WebSiteImageUrl)/category-banner/@(Model.BrandId).jpg" alt="@Model.Brand" />
            </div>
        }
        else if (Model.CategoryBannerActive)
        {
            <div class="category-banner">
                <img src="@(Parameters.WebSiteImageUrl)/category-banner/@(Model.CategoryId).jpg" alt="@Model.Category" />
            </div>
        }
        else if (Model.ParentCategoryBannerActive)
        {
            <div class="category-banner">
                <img src="@(Parameters.WebSiteImageUrl)/category-banner/@(Model.ParentCategoryId).jpg" alt="@Model.ParentCategoryId" />
            </div>
        }
        else if (Parameters.Theme != "JB")
        {
            <div class="category-banner">
                @Html.Raw(Parameters.ProductPageDescriptionWide)
            </div>            
        }
        <div class="clearfix"></div>
    </div>   
}
@if (!showCategoriesOnLeft)
{
    <div class="clearfix"></div>
}

@if (Parameters.Theme == "HA")
{
    if (Model.BrandBannerActive || Model.CategoryBannerActive || Model.ParentCategoryBannerActive || !string.IsNullOrEmpty(Parameters.ProductPageDescriptionWide))
    {
    <div class="@infoBlockClass">
        @if (Model.BrandBannerActive)
        {
            <div class="category-banner">
                <img src="@(Parameters.WebSiteImageUrl)/category-banner/@(Model.BrandId).jpg" alt="@Model.Brand" />
            </div>
        }
        else if (Model.CategoryBannerActive)
        {
            <div class="category-banner">
                <img src="@(Parameters.WebSiteImageUrl)/category-banner/@(Model.CategoryId).jpg" alt="@Model.Category" />
            </div>
        }
        else if (Model.ParentCategoryBannerActive)
        {
            <div class="category-banner">
                <img src="@(Parameters.WebSiteImageUrl)/category-banner/@(Model.ParentCategoryId).jpg" alt="@Model.ParentCategoryId" />
            </div>
        }
        else if (Parameters.Theme != "JB")
        {
            <div class="category-banner">
                @Html.Raw(Parameters.ProductPageDescriptionWide)
            </div>            
        }
        <div class="clearfix"></div>
    </div>
    }
    if (Model.LinkedProducts.Count() > 0)
    {
    <div class="@infoBlockClass">
        <div class="col-xs-12 info-block-content">
            <div class="col-xs-12">
                <h4>Bunları da eklemek ister misiniz?</h4>
                <table class="table">
                    @foreach (var ln in Model.LinkedProducts)
                    {
                        <tr>
                            <td style="width: 10%;">
                                <a  class="hizliBak" href="javascript:void(0);" title="@(ln.ProductName.Replace("\"", ""))" data-id="@ln.LinkedId" data-name="@ln.ProductName" data-prcode="@ln.ProductCode" data-imgcount="@ln.ProductImageCount">
                                    <img alt="@(ln.ProductName.Replace("\"", ""))" src="@(Parameters.WebSiteImageUrl)/product-small/@(ln.LinkedId)_1@(linkedImageType).jpg" id="ip_@ln.LinkedId" style="max-width:100%;"  />
                                </a>
                            </td>
                            <td>
                                <a  class="hizliBak linkedUrl" href="javascript:void(0);" title="@(ln.ProductName.Replace("\"", ""))" data-id="@ln.LinkedId" data-name="@ln.ProductName" data-prcode="@ln.ProductCode" data-imgcount="@ln.ProductImageCount">@(ln.ProductName)
                                    <span class="right">@ln.Price.ToString(priceFilterStr) TL</span>
                                </a>
                            </td>
                        </tr>
                    }
                </table>
            </div>
        </div>
        <div class="clearfix"></div>
    </div>
    }
    
    <!--çağrı merkezi - soru sor - nakliyat -->
    <div class="@infoBlockClass">
        <div class="col-md-3 info-block-content">
            <div class="col-xs-4 first last info-block-icon">
                <i class="fa fa-phone fa-4x"></i>
            </div>
            <div class="col-xs-8 last">
                <span class="info-block-title">Çağrı Merkezi</span>
                <span class="info-block-phone">@Parameters.PrimaryPhoneNumber</span>
            </div>
        </div>
        <div class="col-md-4 info-block-content">
            <div class="col-xs-2 first last info-block-icon">
                <i class="fa fa-question fa-4x"></i>
            </div>
            <div class="col-xs-10 last">
                <span class="info-block-title">Destek Merkezi</span>
                <span class="info-block-text"><a href="#urunSoruSor" class="bolder urunSoruSorLink">@(!string.IsNullOrEmpty(Model.QuestionText) ? Model.QuestionText : Parameters.ProductDefaultQuestionText)</a></span>
            </div>
        </div>
        <div class="col-md-5 info-block-content info-block-content-last">
            <div class="col-xs-2 first last info-block-icon">
                <i class="fa fa-truck fa-4x"></i>
            </div>
            <div class="col-xs-10 last">
                <span class="info-block-title">Teslimat</span>
                <span class="info-block-text"><a href="/Icerik/Delivery" class="bolder" target="_blank">Nakliye ve Montaj Koşulları için Tıklayın</a></span>
            </div>
        </div>
        <div class="clearfix"></div>
    </div>
}
<!--tab-->
<div class="@productTabClass">
    @if (Parameters.Theme == "JB" && productRelatedsPosition == "bottomright")
    {
        <div class="product-contact">
            <div class="col-xs-6 first">
                <h5>Telefon Destek Hattı</h5>
                @Parameters.PrimaryPhoneNumber<br />
                (09:00 - 18:30 Pazar Günü Hariç)
            </div>
            <div class="col-xs-6 last">
                <h5>Müşteri Destek Hattı</h5>
                <a href="#urunSoruSor" class="bolder urunSoruSorLink">Müşteri temsilcimizden<br />
                    Destek almak için tıklayınız</a>
            </div>
        </div>
        <div class="clearfix"></div>
        <hr />
    }

    @if (Parameters.UseTabsInProductDetail)
    {
        var urunDetayAciklama = Model.Description.Replace(Environment.NewLine, "<br />") + Model.Information;
@*<script>
            alert('"@urunDetayAciklama"');
        </script>*@
        <div id="tabs">
            <ul class="tab-titles">
                <li><a href="#tab-description">Ürün Açıklaması</a></li>
                @if (Model.IsActive && productRelatedsPosition != "bottomright")
                {
                    <li><a href="#tab-installment" id="tab-installment-link">Taksit Seçenekleri</a></li>
                    if (Parameters.UsePaymentBond && !(Parameters.OnlyUseCCandMTforOpportunityProduct && Model.OpportunityProduct))
                    {
                    <li><a href="#tab-installmentBond" id="tab-installmentbond-link">Senet Taksit Seçenekleri</a></li>
                    }
                }
                @if (!string.IsNullOrEmpty(Parameters.FaceBookCommentCode) && productRelatedsPosition != "bottomright")
                {
                    <li><a href="#tab-comments">Yorumlar</a></li>
                }
                @{
                int say = 0;
                foreach (var pt in Model.ProductTabsWithNewTab)
                {
                    say++;
                    <li><a href="#tab-@(say.ToString())">@pt.TabName</a></li>
                }
                }
                @if (Model.IsManager)
                {
                    <li><a href="#tab-varianturls" id="tab-varianturls-link">Variant</a></li>
                }
            </ul>


            <div id="tab-description">
                <div class="tab-inner productDescription" itemprop="description">
                    <div class="std">
                        @if (!string.IsNullOrEmpty(urunDetayAciklama) && urunDetayAciklama != " ")
                        {
                            <br />@Html.Raw(Model.Description.Replace(Environment.NewLine, "<br />"))
                            if (Parameters.ProductShowTabsOverExtraFields)
                            {
                                foreach (var pt in Model.ProductTabsWithoutNewTab)
                                {
                            <h4>@pt.TabName</h4>
                            @Html.Raw(pt.Html)           
                                }
                            }
                            @Html.Raw(Model.Information)
                            
                            if (!Parameters.ProductShowTabsOverExtraFields)
                            {
                                foreach (var pt in Model.ProductTabsWithoutNewTab)
                                {
                            <h4>@pt.TabName</h4>
                            @Html.Raw(pt.Html)           
                                }
                            }
                        }
                        else
                        {
                            @Html.Raw(Parameters.ProductPageDefaultDescription)
                            foreach (var pt in Model.ProductTabsWithoutNewTab)
                            {
                            <h4>@pt.TabName</h4>
                            @Html.Raw(pt.Html)           
                            }
                        }

                    </div>
                </div>
            </div>
            @if (Model.IsActive && productRelatedsPosition != "bottomright")
            {                  
                <div id="tab-installment">
                    <div class="tab-inner">
                        <div style="margin: 10px 0;" class="installmentsTablePlaceHolder">
                            @{Html.RenderAction("ProductInstallmentsTable", "Product", new { id = productIdForDetails });}
                        </div>
                        <div class="clearfix"></div>
                    </div>
                    <div class="clearfix"></div>
                </div>
                              if (Parameters.UsePaymentBond && !(Parameters.OnlyUseCCandMTforOpportunityProduct && Model.OpportunityProduct))
                              {
                <div id="tab-installmentBond">
                    <div class="tab-inner">
                        <div style="margin: 10px 0;" class="installmentsTablePlaceHolderBond">
                            @{Html.RenderAction("ProductInstallmentsTable", "Product", new { id = productIdForDetails, PosVoucher = "S" });}
                        </div>
                        @Html.Raw(Parameters.VoucherPaymentDescription)
                        <div class="clearfix"></div>
                    </div>
                    <div class="clearfix"></div>
                </div>
                              }
            }
            @{
            if (!string.IsNullOrEmpty(Parameters.FaceBookCommentCode) && productRelatedsPosition != "bottomright")
            {
                <div id="tab-comments">
                    <div class="tab-inner">
                        @Html.Raw(Parameters.FaceBookCommentCode.Replace("{URL}", (Parameters.HttpsEnabled && !Request.Url.Host.Contains("cloudapp") && !Request.Url.Host.Contains("localhost") ? Parameters.WebSiteUrl.Replace("http:", "https:") : Parameters.WebSiteUrl) + Model.LinkUrl))
                        @{Html.RenderAction("ManageContentLink", "Partials", new { id = 410 });}
                    </div>
                </div>
            }
            }
            @{
            say = 0;
            foreach (var pt in Model.ProductTabsWithNewTab)
            {
                say++;
                <div id="tab-@(say.ToString())">
                    <div class="tab-inner">
                        @Html.Raw(pt.Html)
                    </div>
                </div>             
            }
            }
            @if (Model.IsManager)
            {
                <div id="tab-varianturls">
                    <div class="tab-inner">
                        <table class="table table-bordered">
                            <tr>
                                <td style="width: 30%;">Ürün Adı</td>
                                <td>URL</td>
                            </tr>
                            @foreach (var varUrl in Model.variantUrlsList)
                            {
                                <tr>
                                    <td><a href="@(varUrl.LinkUrl)">@(varUrl.ProductName)</a></td>
                                    <td>@(Parameters.WebSiteUrl.Replace("http://", (Parameters.HttpsEnabled ? "https://" : "http://")))@(varUrl.LinkUrl)</td>
                                </tr>                                
                            }
                        </table>
                        <div class="clearfix"></div>
                    </div>
                </div>
            }
@*        <div id="tab-attribute1" class="tab-content" style="display: none;">
            @Html.Raw(Model.Information)
        </div>*@ @*        <div id="tab-review" class="tab-content" style="display: none;">
            <div id="review">
            </div>
            <h2 id="review-title">
                Yorum yazın</h2>
            <b>Adınız Soyadınız:</b><br />
            <input type="text" name="name" value="" />
            <br />
            <br />
            <b>Yorumunuz:</b>
            <textarea name="text" cols="40" rows="8" style="width: 98%;"></textarea>
            <span style="font-size: 11px;"><span style="color: #FF0000;">Not:</span> HTML çevrilmeyecektir!</span><br />
            <br />
            <b>Değerlendirme:</b> <span>Kötü</span>&nbsp;
            <input type="radio" name="rating" value="1" />
            &nbsp;
            <input type="radio" name="rating" value="2" />
            &nbsp;
            <input type="radio" name="rating" value="3" />
            &nbsp;
            <input type="radio" name="rating" value="4" />
            &nbsp;
            <input type="radio" name="rating" value="5" />
            &nbsp; <span>İyi</span><br />
            <br />
            <b>Aşağıdaki kodu yazınız:</b><br />
            <input type="text" name="captcha" value="" />
            <br />
            <img src="index.php?route=product/product/captcha" alt="" id="captcha" /><br />
            <br />
            <div class="buttons">
                <div class="right">
                    <a id="button-review" class="button"><span>Devam et</span></a>
                </div>
            </div>
        </div>*@
        </div>
    }
    else
    {
        <h3 class="product-details-title">Ürün Açıklaması</h3>
        <div class="tab-inner-tda">
            <div class="productDescription">
                <div class="std">@Html.Raw(Model.Description.Replace(Environment.NewLine, "<br />"))
                    <br />
                    <br />
                    @Html.Raw(Model.Information)
                </div>
            </div>
        </div>
        <h3 class="product-details-title">Taksit Seçenekleri</h3>
        <div class="tab-inner-tda">
            @if (Model.IsActive)
            {
                <div class="installmentsTablePlaceHolder">
                    @{Html.RenderAction("ProductInstallmentsTable", "Product", new { id = productIdForDetails });}
                </div>
            }
            else
            {
                <text>Ürün geçici olarak temin edilememektedir!</text>
            }
            <div class="clearfix"></div>
        </div>
            if (Parameters.UsePaymentBond && !(Parameters.OnlyUseCCandMTforOpportunityProduct && Model.OpportunityProduct))
            {
        <h3 class="product-details-title">Senet Taksit Seçenekleri</h3>
        <div class="tab-inner-tda">
            @if (Model.IsActive)
            {
                <div class="installmentsTablePlaceHolderBond">
                    @{Html.RenderAction("ProductInstallmentsTable", "Product", new { id = productIdForDetails, PosVoucher = "S" });}
                </div>
            }
            else
            {
                <text>Ürün geçici olarak temin edilememektedir!</text>
            }
            <div class="clearfix"></div>
        </div>
            }
    }
</div>

@if (Parameters.Theme == "HA")
{
    <div class="@infoBlockClass">
        <div class="tab-inner">
            @Html.Raw(Parameters.FaceBookCommentCode.Replace("{URL}", (Parameters.HttpsEnabled && !Request.Url.Host.Contains("cloudapp") && !Request.Url.Host.Contains("localhost") ? Parameters.WebSiteUrl.Replace("http:", "https:") : Parameters.WebSiteUrl) + Model.LinkUrl))
            @{Html.RenderAction("ManageContentLink", "Partials", new { id = 410 });}
        </div>
    </div>
}
@if (productRelatedsPosition == "bottomright")
{
    if (Model.SuggestedGroup > 0)
    {
    <div class="hidden-xs hidden-sm col-md-7 col-lg-7 first last right">
        <!--Benzer Ürünler-->
        @{Html.RenderAction("RelatedProductsInCategory", "Partials", new { CategoryId = Model.SuggestedGroup, CategoryName = "Önerilen Ürünler", ItemId = Model.ProductId, ItemCount = Parameters.MaxProductCountForSuggestedProducts, Position = "bottomright", Title = "Önerilen Ürünler" });}
        <!--Benzer Ürünler-->
    </div>
    }
    <div class="hidden-xs hidden-sm col-md-7 col-lg-7 first last right">
        <!--Benzer Ürünler-->
        @{Html.RenderAction("RelatedProductsInCategory", "Partials", new { CategoryId = Model.CategoryId, CategoryName = Model.Category, ItemId = Model.ProductId, ItemCount = Parameters.MaxProductCountForRelatedProducts, Position = "bottomright", Title = "Benzer Ürünler", randomOrder = true });}
        <!--Benzer Ürünler-->
    </div>
}
<div class="clearfix"></div>
@if (productRelatedsPosition == "bottom")
{
    <div class="col-md-12 col-lg-12 first last">
        <!--Benzer Ürünler-->
        @{Html.RenderAction("RelatedProductsInCategory", "Partials", new { CategoryId = Model.CategoryId, CategoryName = Model.Category, ItemId = Model.ProductId, ItemCount = Parameters.MaxProductCountForRelatedProducts, Position = "bottom", Title = "Benzer Ürünler", randomOrder = true });}
        <!--Benzer Ürünler-->
    </div>
}
@if (!string.IsNullOrEmpty(Parameters.FaceBookCommentCode) && productRelatedsPosition == "bottomright")
{
    <div id="col-xs-12">
        @Html.Raw(Parameters.FaceBookCommentCode.Replace("{URL}", (Parameters.HttpsEnabled && !Request.Url.Host.Contains("cloudapp") && !Request.Url.Host.Contains("localhost") ? Parameters.WebSiteUrl.Replace("http:", "https:") : Parameters.WebSiteUrl) + Model.LinkUrl))
        @{Html.RenderAction("ManageContentLink", "Partials", new { id = 410 });}
    </div>
}

@*ürün hakkında soru sor*@
<div style="display: none;">
    <div id="urunSoruSor">
        @{ Html.RenderAction("GetForProduct", "ContactUs", new { productName = productIdForDetails + " - " + Model.ProductName });}
    </div>
    <div id="taksitSecenekleriLb">
        @if (Model.IsActive)
        {
            <div class="installmentsTablePlaceHolder">
                @{Html.RenderAction("ProductInstallmentsTable", "Product", new { id = productIdForDetails });}
            </div>
        }
    </div>
</div>
@*ürün hakkında soru sor*@
<script type="text/javascript">
    $(function ()
    {
        $("#tabs").tabs({
            activate: function (event, ui)
            {
            }
        });
    });
</script>
<!--tab-->
<script type="text/javascript">
    $('#tabs a').tabs();

    $('a.cgLink222').click(function ()
    {
        var qsId = $(this).attr('id').split("_")[1];
        $('#content').load('/Categories/Get', { id: qsId });
        return false;
    });

    $('a.prLink222').click(function ()
    {
        var qsId = $(this).attr('id').split("_")[1];
        $('#content').load('/Products/Get', { id: qsId });
        return false;
    });


    $('#headermodule').hide();
    if ($(document).scrollTop() > 170)
    {
        $('html, body').animate({ scrollTop: 170 }, 'slow');
    }
</script>
<script type="text/javascript" charset="utf-8">
    $(document).ready(function ()
    {
        var lbWidth = $(window).width() - 90;
        if (lbWidth > 900)
            lbWidth = 900;
        var lbHeight = $(window).height() - 90;
        if (lbHeight > 750)
            lbHeight = 750;
        $(".urunSoruSorLink").fancybox({
            autoScale: false,
            width: lbWidth,
            height: lbHeight,
            fitToView: false,
            autoSize: false,
            autoDimensions: false,
            autoScale: false,
        });
        $(".taksitSecenekleriLb").fancybox({
            autoScale: false,
            width: lbWidth,
            height: lbHeight,
            fitToView: false,
            autoSize: false,
            autoDimensions: false,
            autoScale: false,
            onComplete: function ()
            {
            },
            afterShow: function ()
            {
            }
        });
        $(".product-detail-image").fancybox();
        if ($(document).width() < 1000)
        {
            $('.product-review-main').removeClass('first');
            $('.product-review-main .product-images').addClass('last');
            $('.product-review-main .product-images a').attr('href', 'javascript:void(0);');
            $('.product-tabs').removeClass('first');
        }
    });
    function addToWishList(id)
    {
        $("#dialog-form").load("/WishList/List", { ProductId: id });
        $("#dialog-form").dialog("open");
    }
    $(function ()
    {
        $("#dialog:ui-dialog").dialog("destroy");
        $("#dialog-form").dialog({
            autoOpen: false,
            height: 300,
            width: 550,
            modal: true,
            close: function ()
            {
                allFields.val("").removeClass("ui-state-error");
            }
        });
    });
    function PushUrl(newtitle, newurl)
    {
        window.history.pushState(newtitle, newtitle, newurl);
    }
</script>
<div id="dialog-form" title="Liste Seç">
</div>
@if (Parameters.Theme == "BT")
{ 
    <script type="text/javascript">
        $('div.toCart a.addToCart img').attr({ 'src': '', 'alt': '' });
        $('div.toCart a.addToCart').attr({ 'class': 'addToCart exclusive ajax_add_to_cart_button btn_add_cart' });
        $(' .summary .description .cart .addToCart img').attr({ 'src': '' });
    </script>
}

@if (Parameters.WebSiteTrackingCode != "")
{ 
    <script type="text/javascript">

        var _gaq = _gaq || [];
        _gaq.push(['_setAccount', '@Parameters.WebSiteTrackingCode']);
        _gaq.push(['_setDomainName', '@Parameters.WebSiteTrackingDomainName']);
        _gaq.push(['_setAllowLinker', true]);
        _gaq.push(['_trackPageview']);

        (function ()
        {
            var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
            ga.src = ('https:' == document.location.protocol ? 'https://' : 'http://') + 'stats.g.doubleclick.net/dc.js';
            var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
        })();
    </script>

}
@if (!string.IsNullOrEmpty(Parameters.AdWordsConversionId) && Parameters.AdWordsConversionId != "-")
{
    <script>
        var google_tag_params = {
            ecomm_prodid: '@(Model.ProductId)',
            ecomm_pagetype: 'product',
            ecomm_totalvalue: '@(Model.Price)'
        };
    </script>
    <script type="text/javascript">
        /* <![CDATA[ */
        var google_conversion_id = parseInt(@(Parameters.AdWordsConversionId));
        var google_custom_params = window.google_tag_params;
        var google_remarketing_only = true;
        /* ]]> */
    </script>
    <script type="text/javascript" src="//www.googleadservices.com/pagead/conversion.js">
    </script>
    <noscript>
        <div style="display: inline;">
            <img height="1" width="1" style="border-style: none;" alt="" src="//googleads.g.doubleclick.net/pagead/viewthroughconversion/@(Parameters.AdWordsConversionId)/?value=0&guid=ON&script=0" />
        </div>
    </noscript> 
}